package com.act.moudles.baseAct.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * 任务注解(TaskAno)表实体类
 *
 * @author makejava
 * @since 2023-05-13 23:33:36
 */
@SuppressWarnings("serial")
@Data
@TableName("s_task_ano")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TaskAno {
    //主键
    @TableId(value = "id" ,type= IdType.AUTO)
    private Long id;
    //任务名称
    private String taskName;
    //任务编码
    private String taskCode;
    //任务排序
    private Integer taskSort;
    //租户ID
    private String tenantId;
    //流程定义ID
    private String procdefKey;
    //创建时间
    private Date createTime;

    private String sid;

    @TableField(exist = false)
    private Long deployId;

    private String userFlowKey;

    @TableField(exist = false)
    private String assigine;

    private String taskType;


    public LambdaQueryWrapper<TaskAno> query(){
        LambdaQueryWrapper<TaskAno> query = new LambdaQueryWrapper<>();
        query.eq(id != null,TaskAno::getId,id);
        query.like(StringUtils.isNotEmpty(taskName),TaskAno::getTaskName,taskName);
        query.eq(StringUtils.isNotEmpty(tenantId),TaskAno::getTenantId,tenantId);
        query.eq(StringUtils.isNotEmpty(procdefKey),TaskAno::getProcdefKey,procdefKey);
        query.orderByAsc(TaskAno::getTaskSort);
        return query;
    }

}

